//
//  PersonTableViewCell.m
//  Shengzhuli
//
//  Created by 卡忙科技 on 16/8/1.
//  Copyright © 2016年 kamangkeji. All rights reserved.
//

#import "PersonTableViewCell.h"

@interface PersonTableViewCell()

@property (weak, nonatomic) IBOutlet UIImageView *iconImage;
@property (weak, nonatomic) IBOutlet UILabel *titleLab;
@property (weak, nonatomic) IBOutlet UILabel *subTitleLab;
@property (weak, nonatomic) IBOutlet UILabel *countLab;
@property (weak, nonatomic) IBOutlet UIView *shareView;

@end
@implementation PersonTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setTitle:(NSString *)title
{
    _title = title;
    self.titleLab.text = title;
    self.iconImage.image = GetImage(title);
    if ([title isEqualToString:@"捡漏专区"]) {
        self.shareView.hidden = NO;
    }else {
        self.shareView.hidden = YES;
    }
}
- (void)setSubTitle:(NSString *)subTitle
{
    _subTitle = subTitle;
    self.subTitleLab.text = subTitle;
}
- (void)setUnreadCount:(NSInteger)unreadCount
{
    _unreadCount = unreadCount;
    if (unreadCount == 0) {
        self.countLab.text = @"";
        return;
    }
    self.countLab.text = [NSString stringWithFormat:@"%zd",unreadCount];
}

- (void)layoutSubviews
{
    [super layoutSubviews];
//    if ([self.title isEqualToString:@"我的关注"]) {
//        self.separatorInset = UIEdgeInsetsMake(0, ScreenW, 0, 0);
//    }
//    for (UIView *subview in self.contentView.superview.subviews) {
//        if ([NSStringFromClass(subview.class) hasSuffix:@"SeparatorView"]) {
//            subview.hidden = NO;
//        }
//    }
}

@end
